Electronic controls for automotive internal combustion engines select spark timing for each individual cylinder as calculated from engine speed, mass air flow rate and manifold pressure as the main variables and several less influential factors. The calculation and execution is carried out by a programmed microprocessor having inputs from sensors such as a manifold pressure sensor and a crankshaft position sensor. The crankshaft position sensor is the source of information for each cylinder or cylinder pair position from which spark timing is referenced, as well as engine speed. Speed is determined by measuring the time interval between two reference pulses produced by the position sensor and converting the interval to speed. The speed is used as the basis for the control of the fueling and spark firing of the following cylinders. The U.S. Pat. No. 4,351,306 to Luckman et al is an example of such a system.
The time interval between the reference pulses, known as the reference period, is used to determine the commanded spark advance angle. This commanded spark advance angle is then delivered either by counting the reference pulses (known as position based systems) or by converting it into a count down parameter in time (known as time based systems). The commanded spark advance is not optimal for either system because it is based on the past engine speed, not on the engine speed at the time of firing. This causes one type of spark timing error commonly known as calculation error. For time based systems, the conversion of the spark timing command from crank angle degrees to a time unit using the past average engine speed causes an additional spark timing error, called delivery error. The errors are particularly significant when the engine speed is changing rapidly from one spark firing event to the next. Then the past engine speed, in itself, is not a good indicator of the future speed, especially when the speed measurement is taken in a previous combustion cycle. Large spark timing errors can occur for systems which use only two pulses per engine revolution for four cylinder engines, for example. These large timing errors can cause the engine to stall during engine starting, when a cylinder misfires or when sudden changes in load occur.
A proposal to detect the trend in speed change and modify the measured speed in accordance with the trend is discussed in the U.S. Pat. No. 4,424,568 to Nishimura et al. There, reference pulses are generated at the top dead center of each cylinder for a four cylinder engine. The pulses then are spaced 180.degree. of crankshaft rotation. The speed N is determined for each reference time by an undisclosed method. Then at each reference time the speeds determined for that time and for the previous reference time are used to calculate a predicted speed for two reference periods in the future thereby introducing an opportunity for calculation error. That is, the information used to calculate the predicted speed is least one engine revolution old by the time the speed is utilized. The prediction a expressed in the form N.sub.5 =N.sub.3 +X(N.sub.3 -N.sub.2) where X is a weighting constant. The first term is a base speed and the difference term is a measure of acceleration to adjust for the speed trend. After the spark angle is calculated using the predicted speed, the firing can only be executed by calculating a waiting time interval from a reference pulse which is far from the spark angle, thus introducing the opportunity for a major delivery error.